FROM nodered/node-red:4.0.3

# Set work directory
WORKDIR /usr/src/node-red

RUN rm -rf /usr/src/node-red/node_modules/@node-red
RUN rm -rf /data/flow.json

# 复制压缩包
COPY files/@node-red.tar.gz .
# 复制流程文件
COPY files/data /data

#解压压缩包
RUN tar -zxvf @node-red.tar.gz -C node_modules

# Expose the listening port of node-red
EXPOSE 1880

# ENTRYPOINT ["npm", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]
ENTRYPOINT ["./entrypoint.sh"]